//
//  PsychologistViewController.swift
//  Psychologist
//
//  Created by Gavin YANG on 3/4/15.
//  Copyright (c) 2015 HDIC. All rights reserved.
//

import UIKit

class PsychologistViewController: UIViewController {

    @IBAction func button_Nothing(sender: UIButton) {
        performSegueWithIdentifier("show nothing", sender: nil)
    }
    
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
        var destination = segue.destinationViewController as? UIViewController
        
        if let navCon = destination as? UINavigationController {
            destination = navCon.visibleViewController
        }
        
        if let hvc = destination as? HappinessViewController {
            if let identifier = segue.identifier? {
                switch identifier {
                    case "show sad": hvc.happiness = 0
                    case "show happy": hvc.happiness = 100
                    case "show nothing": hvc.happiness = 25
                    default: hvc.happiness = 50
                }
            }
        }
    }
}
